﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Crap4Net.CoverageParsers
{
    public class CoverageParserFactory
    {
        public const string MSTEST_TOOL_NAME = "MSTest";
        public const string MSTESTXML_TOOL_NAME = "VSXml";
        public const string PARTCOVER_TOOL_NAME = "PartCover";
        public const string NCOVER3_TOOL_NAME = "NCover3";

        public static ICoverageParser CreateParser(string toolName)
        {
            switch (toolName)
            {
            	case MSTEST_TOOL_NAME:
                    return new VSCoverageParser();
            	case MSTESTXML_TOOL_NAME:
                    return new VsXmlParser();
            	case PARTCOVER_TOOL_NAME:
                    return new PartCoverageParser();
                case NCOVER3_TOOL_NAME:
                    return new NCover3CoverageParser();
                default:
                    throw new ArgumentException(String.Format("unsupported Coverage tool: {0}", toolName));

            }
        }
    }
}
